********************************************************************************
* Exporting representativeness table for multi-country COVID paper (SLE1 sample)
* last updated: 2020-10-22
* Salim Benhachmi
********************************************************************************

use "$da/SLE1", clear

local variables hhsize female_cv

foreach var of local variables {
		
	sum `var' if covid_sample == 1
	loc mean_`var'_samp = round(`r(mean)', 0.01)
}

local variables2 hhsize female_bl

foreach var of local variables2 {
		
	sum `var'
	loc mean_`var'_pop = round(`r(mean)', 0.01)
}

clear
set obs 5

gen sample_avg = .
gen population_avg = .

replace sample_avg = 1 in 1
replace population_avg = 1 in 1

replace sample_avg = `mean_hhsize_samp' in 2
replace population_avg = `mean_hhsize_pop' in 2

replace sample_avg = `mean_female_cv_samp' in 3
replace population_avg = `mean_female_bl_pop' in 3

replace sample_avg = . in 4
replace population_avg = . in 4

replace sample_avg = . in 5
replace population_avg = . in 5

gen sample_avg_weight = .
order sample_avg sample_avg_weight population_avg

gen national_avg = .
replace national_avg = 0.55 in 1
replace national_avg = 5.81 in 2
replace national_avg = 0.50 in 3
replace national_avg = 0.14 in 4
replace national_avg = . in 5

export excel using "$dtab/Representativeness Table.xlsx", sheetmodify cell(C99)

********************************************************************************
